import matplotlib.pyplot as plt
import pandas as pd
df=pd.read_excel('餐厅订单信息.xlsx',index_col=0)
plt.rcParams['font.sans-serif']='SimHei'
plt.figure(figsize=(8,5))
x=df['价格']
plt.xlabel('菜品价格/元')
plt.ylabel('菜品数量')
plt.title('不同价格区间菜品数量分布直方图')
plt.hist(x,bins=12,color=(0.894,0,0.498),edgecolor='k')
plt.show()
x1=df['价格']
y1=df['消费金额']
plt.scatter(x1,y1)
plt.legend(('菜品价格与消费金额',),loc='lower right')
plt.show()